//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mapper;

import com.example.entity.Recruitment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface RecruitmentMapper {
    @Select({"select * from recruitment where club_id = #{clubId}"})
    List<Recruitment> selectAll(Integer clubId);

    @Select({"select * from recruitment where id = #{id}"})
    Recruitment selectById(Integer id);

    @Insert({"insert into recruitment (club_id,title,descr,requirements,start_date,end_date) values (#{clubId},#{title},#{descr},#{requirements},#{startDate},#{endDate})"})
    int insert(Recruitment recruitment);

    @Update({"update recruitment set club_id = #{clubId}, title = #{title},descr = #{descr},requirements = #{requirements},start_date = #{startDate},end_date = #{endDate} where id=#{id}"})
    int updateById(Recruitment recruitment);

    @Delete({"delete from recruitment where id = #{id}"})
    int deleteById(Integer id);


    List<Recruitment> selectByClubs(List<Integer> clubIds,String title);
}
